From: Keir Fraser Date: Mon, 31 Aug 2009 08:47:30 +0000 (+0100) Subject: x86: fix get_free_pirq X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13412 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=b05c476cf6595bbdc7017e9c2a683fdd5cf72117;p=xen.git x86: fix get_free_pirq GSI should not be allocated for other purpose, so change the hard code limit. Also fix the out of loop checking, it should be '<' instead of '=='. Signed-off-by: Qing He --- diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 1f5e1a666d..1e2fa8b147 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1254,10 +1254,10 @@ int get_free_pirq(struct domain *d, int type, int index) } else { - for ( i = d->nr_pirqs - 1; i >= 16; i-- ) + for ( i = d->nr_pirqs - 1; i >= nr_irqs_gsi; i-- ) if ( !d->arch.pirq_irq[i] ) break; - if ( i == 16 ) + if ( i < nr_irqs_gsi ) return -ENOSPC; }